#pragma once

#include <QMouseEvent>
#include <QPainter>
#include <QRect>
#include <QVBoxLayout>
#include <QVector>
#include <QWidget>

#include "../StringResource.h"
#include "AIPanelBase.h"
#include "core/ImageMgr.h"
#include "core/StyleMgr.h"

class CAIPanelDataBusinessTypePanel;
class CAIPanelDataBroker : public CAIPanelBase {
  Q_OBJECT
 public:
  CAIPanelDataBroker();
  virtual ~CAIPanelDataBroker();

  void ClearPanels();
  virtual void Init();
  void Draw(QPainter* painter, int height);
  void SetRect(QRect rct) { m_rct = rct; }
  virtual int OnMouseMove(int x, int y);
  virtual void mousePressEvent(QMouseEvent* event) override;

 protected:
  std::map<std::string, SImage> m_pimgBroker;
  std::vector<CAIPanelDataBusinessTypePanel*> m_pPanels;
  int m_nTitleHeight;
  QRect m_rct;

  void paintEvent(QPaintEvent* event) override;
};
